<?php
require_once(dirname(__FILE__)."/../core/safeParam.php");
require_once(dirname(__FILE__).'/../includes/config.php');
require_once(dirname(__FILE__).'/../core/database.php');
require_once(dirname(__FILE__).'/../core/pages.php');
$function = $_GET['function'];

$pageModel = new Pages();

switch($function) {

  case "edit-banner" :
    $pageModel->pagesEditBanner($_POST);
    break;

  case "add" :
    $pageModel->pagesAdd($_POST);
    break;

  case "add-link" :
    $pageModel->pagesAddLink($_POST);
    break;

  case "edit" :
    $pageModel->pagesEdit($_POST);
    break;

  case "edit-link" :
    $pageModel->pagesEditLink($_POST);
    break;

  case "delete" :
    $pageModel->pagesDelete($_GET);
    break;

  case "remove-menu" :
    $pageModel->pagesRemoveMenu($_GET['id']);
    break;

  case "add-menu" :
    $pageModel->pagesAddMenu($_GET['id']);
    break;

  case "order" :
    $pageModel->pagesOrder($_POST);
    break;

  case "remove-sub" :
    $pageModel->pagesRemoveSub($_GET['id']);
    break;


}
?>
